<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta name="Content-Type" content="text/html; charset=UTF-8" />
<title>Class: Sass::Media::QueryList</title>
<link rel="stylesheet" href="style.css" tppabs="http://sass-lang.com/docs/yardoc/css/style.css" type="text/css" media="screen" charset="utf-8" />
<link rel="stylesheet" href="common.css" tppabs="http://sass-lang.com/docs/yardoc/css/common.css" type="text/css" media="screen" charset="utf-8" />

<script type="text/javascript" charset="utf-8">
  relpath = '../..';
  if (relpath != '') relpath += '/';
</script>
<script type="text/javascript" charset="utf-8" src="jquery.js" tppabs="http://sass-lang.com/docs/yardoc/js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="app.js" tppabs="http://sass-lang.com/docs/yardoc/js/app.js"></script>

  </head>
  <body>
    <script type="text/javascript" charset="utf-8">
      if (window.top.frames.main) document.body.className = 'frames';
    </script>
    
    <div id="header">
      <div id="menu">
  
    <a href="_index.html" tppabs="http://sass-lang.com/docs/yardoc/_index.html">Index (Q)</a> &raquo; 
    <span class='title'><a href="Sass-1.html" tppabs="http://sass-lang.com/docs/yardoc/Sass.html" title="Sass (module)">Sass</a></span> &raquo; <span class='title'><a href="Media.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Media.html" title="Sass::Media (module)">Media</a></span>
     &raquo; 
    <span class="title">QueryList</span>
  
  
  <div class="noframes"><span class="title">(</span><a href="javascript:if(confirm(%27http://sass-lang.com/docs/yardoc/Sass/Media/.  \n\nThis file was not retrieved by Teleport Pro, because the server reports that this file cannot be found.  \n\nDo you want to open it from the server?%27))window.location=%27http://sass-lang.com/docs/yardoc/Sass/Media/.%27" tppabs="http://sass-lang.com/docs/yardoc/Sass/Media/." target="_top">no frames</a><span class="title">)</span></div>
</div>

      <div id="search">
  <a id="class_list_link" href="#">Class List</a>
  <a id="method_list_link" href="#">Method List</a>
  <a id ="file_list_link" href="#">File List</a>
</div>

      <div class="clear"></div>
    </div>
    
    <iframe id="search_frame"></iframe>
    
    <div id="content"><h1>Class: Sass::Media::QueryList 
  
  
</h1>

<dl class="box">
  
    <dt class="r1">Inherits:</dt>
    <dd class="r1">
      <span class="inheritName">Object</span>
      
        <ul class="fullTree">
          <li>Object</li>
          
            <li class="next">Sass::Media::QueryList</li>
          
        </ul>
        <a href="#" class="inheritanceTree">show all</a>
      
      </dd>
    
  
  
    
  
    
  
  
    <dt class="r2 last">Defined in:</dt>
    <dd class="r2 last">/var/www/sass-pages/.sass/lib/sass/media.rb</dd>
  
</dl>
<div class="clear"></div>

<h2>Overview</h2><div class="docstring">
  <div class="discussion">
    <p>A comma-separated list of queries.</p>

<p>media_query <span>&#8217;,&#8217; S* media_query</span>*</p>

  </div>
</div>
<div class="tags">
  
</div>

  <h2>Instance Attribute Summary</h2>
  <ul class="summary">
    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#queries-instance_method" title="#queries (instance method)">- (Array&lt;Query&gt;) <strong>queries</strong> </a>
    

    
  </span>
  
  
    
    
  
  
  
  

  
    <span class="summary_desc">The queries contained in this list.</span>
  
</li>

    
  </ul>


  <h2>Instance Method Summary</h2>

  <ul class="summary">
    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#deep_copy-instance_method" title="#deep_copy (instance method)">- (QueryList) <strong>deep_copy</strong> </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Returns a deep copy of this query list and all its children.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#initialize-instance_method" title="#initialize (instance method)">- (QueryList) <strong>initialize</strong>(queries) </a>
    

    
  </span>
  
    <span class="note title constructor">constructor</span>
  
  
  
  
  

  
    <span class="summary_desc">A new instance of QueryList.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#merge-instance_method" title="#merge (instance method)">- (QueryList?) <strong>merge</strong>(other) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Merges this query list with another.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#to_a-instance_method" title="#to_a (instance method)">- (Array&lt;String, Sass::Script::Node&gt;) <strong>to_a</strong> </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Returns a representation of the query as an array of strings and potentially <tt><a href="Node-1.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Node.html" title="Sass::Script::Node (class)">Sass::Script::Node</a></tt>s (if there&#8217;s interpolation in it).</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#to_css-instance_method" title="#to_css (instance method)">- (String) <strong>to_css</strong> </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Returns the CSS for the media query list.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#to_src-instance_method" title="#to_src (instance method)">- (String) <strong>to_src</strong>(options) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Returns the Sass/SCSS code for the media query list.</span>
  
</li>

    
  </ul>
<div id="constructor_details" class="method_details_list">
  <h2>Constructor Details</h2>
  
    <div class="method_details first">
  <p class="signature first" id="initialize-instance_method">
  
    - (<tt><a href="" title="Sass::Media::QueryList (class)">QueryList</a></tt>) <strong>initialize</strong>(queries) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>A new instance of QueryList</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt>Array&lt;<a href="Query.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Media/Query.html" title="Sass::Media::Query (class)">Query</a>&gt;</tt>)</span>
      
      
        <span class='name'>queries</span>
      
      
      
        &mdash;
        See <tt><a href="#queries-instance_method" title="Sass::Media::QueryList#queries (method)">#queries</a></tt>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


13
14
15</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/media.rb', line 13</span>

def initialize(queries)
  @queries = queries
end</pre>
    </td>
  </tr>
</table>
</div>
  
</div>

  <div id="instance_attr_details" class="attr_details">
    <h2>Instance Attribute Details</h2>
    
      
      <span id="queries=-instance_method"></span>
      <span id="queries-instance_method"></span>
      <div class="method_details first">
  <p class="signature first" id="queries-instance_method">
  
    - (<tt>Array&lt;<a href="Query.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Media/Query.html" title="Sass::Media::Query (class)">Query</a>&gt;</tt>) <strong>queries</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>The queries contained in this list.</p>

  </div>
</div>
<div class="tags">
  <h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>Array&lt;<a href="Query.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Media/Query.html" title="Sass::Media::Query (class)">Query</a>&gt;</tt>)</span>
      
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


10
11
12</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/media.rb', line 10</span>

def queries
  @queries
end</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>


  <div id="instance_method_details" class="method_details_list">
    <h2>Instance Method Details</h2>
    
    
      <div class="method_details first">
  <p class="signature first" id="deep_copy-instance_method">
  
    - (<tt><a href="" title="Sass::Media::QueryList (class)">QueryList</a></tt>) <strong>deep_copy</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Returns a deep copy of this query list and all its children.</p>

  </div>
</div>
<div class="tags">
  <h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="" title="Sass::Media::QueryList (class)">QueryList</a></tt>)</span>
      
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


58
59
60</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/media.rb', line 58</span>

def deep_copy
  QueryList.new(queries.map {|q| q.deep_copy})
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="merge-instance_method">
  
    - (<tt><a href="" title="Sass::Media::QueryList (class)">QueryList</a>?</tt>) <strong>merge</strong>(other) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Merges this query list with another. The returned query list queries for the intersection between the two inputs.</p>

<p>Both query lists should be resolved.</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="" title="Sass::Media::QueryList (class)">QueryList</a></tt>)</span>
      
      
        <span class='name'>other</span>
      
      
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="" title="Sass::Media::QueryList (class)">QueryList</a>?</tt>)</span>
      
      
      
      
        &mdash;
        The merged list, or nil if there is no intersection.
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


24
25
26
27
28</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/media.rb', line 24</span>

def merge(other)
  new_queries = queries.map {|q1| other.queries.map {|q2| q1.merge(q2)}}.flatten.compact
  return if new_queries.empty?
  QueryList.new(new_queries)
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="to_a-instance_method">
  
    - (<tt>Array&lt;String, <a href="Node-1.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Node.html" title="Sass::Script::Node (class)">Sass::Script::Node</a>&gt;</tt>) <strong>to_a</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Returns a representation of the query as an array of strings and potentially <tt><a href="Node-1.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Node.html" title="Sass::Script::Node (class)">Sass::Script::Node</a></tt>s (if there&#8217;s interpolation in it). When the interpolation is resolved and the strings are joined together, this will be the string representation of this query.</p>

  </div>
</div>
<div class="tags">
  <h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>Array&lt;String, <a href="Node-1.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Node.html" title="Sass::Script::Node (class)">Sass::Script::Node</a>&gt;</tt>)</span>
      
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


51
52
53</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/media.rb', line 51</span>

def to_a
  Sass::Util.intersperse(queries.map {|q| q.to_a}, ', ').flatten
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="to_css-instance_method">
  
    - (<tt>String</tt>) <strong>to_css</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Returns the CSS for the media query list.</p>

  </div>
</div>
<div class="tags">
  <h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


33
34
35</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/media.rb', line 33</span>

def to_css
  queries.map {|q| q.to_css}.join(', ')
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="to_src-instance_method">
  
    - (<tt>String</tt>) <strong>to_src</strong>(options) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Returns the Sass/SCSS code for the media query list.</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt>{Symbol =&gt; Object}</tt>)</span>
      
      
        <span class='name'>options</span>
      
      
      
        &mdash;
        An options hash (see <tt><a href="CSS.html#initialize-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/CSS.html#initialize-instance_method" title="Sass::CSS#initialize (method)">Sass::CSS#initialize</a></tt>).
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


41
42
43</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/media.rb', line 41</span>

def to_src(options)
  queries.map {|q| q.to_src(options)}.join(', ')
end</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

</div>
    
    <div id="footer">
  Generated on Fri Mar  8 20:33:50 2013 by 
  <a href="javascript:if(confirm(%27http://yardoc.org/  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?%27))window.location=%27http://yardoc.org/%27" tppabs="http://yardoc.org/" title="Yay! A Ruby Documentation Tool">yard</a>
  0.5.3 (ruby-1.8.7).
</div>


  <script type="text/javascript">
  var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
  document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
  </script>
  <script type="text/javascript">
  try {
  var pageTracker = _gat._getTracker("UA-535380-8");
  pageTracker._trackPageview();
  } catch(err) {}</script>


  </body>
</html>